<template>
  <div>
        <a-form
      :form="form"
      @submit="handleSubmit"
      :label-col="{ span: 2 }"
      :wrapper-col="{ span: 5 }"
    >
      <a-form-item label="原密码">
        <a-input
          v-decorator="[
            'password',
            { rules: [{ required: true, message: '请输入原密码！' }] },
          ]"
        />
      </a-form-item>
      <a-form-item label="新密码">
        <a-input
          v-decorator="[
            'newPassword',
            { rules: [{ required: true, message: '请输入新密码！' }] },
          ]"
        />
      </a-form-item>
      <a-form-item :wrapper-col="{ span: 12, offset: 2}">
        <a-button type="primary" html-type="submit"> 修改 </a-button>
      </a-form-item>
    </a-form>
  </div>
</template>

<script>
export default {
  name: "UserInfo",
  data() {
    return {
        form: this.$form.createForm(this, { name: "coordinated" }),
    };
  },
  methods: {
    handleSubmit(e) {
        // e.preventDefault();
      this.form.validateFields((err, values) => {
        if (!err) {
          console.log("修改了： ", values);
          this.$message.success('密码修改成功，即将重新登陆')
        }
      });
    },
  },
};
</script>
<style scoped>

</style>